<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png">
    <div>{{number}}</div>
    <button v-on:click="add">组件数据+</button>
    <div>{{storeData.storeNumber}}</div>
    <button v-on:click="storeNumberAdd">组件数据+</button>
    <HelloWorld msg="Welcome to Your Vue.js App"/>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
import store from "@/store";

export default {
  name: 'Home',
  components: {
    HelloWorld
  },
  data:()=>{
    return{
      number : 0,
      storeData : store
    }
  },
  methods:{
    add(){
      this.number ++;
    },
    storeNumberAdd (){
      store.storeNumberAdd()
    },
    look(){
      console.log(store);
    }
  },
  created() {
    this.look();
  }

}
</script>
